package com.jeesite.modules.otheroutbound.entity;

import jakarta.validation.Valid;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import java.util.Date;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.List;
import com.jeesite.common.collect.ListUtils;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 其它出库单Entity
 * @author 码脑洞
 * @version 2025-04-13
 */
@Table(name="t_other_outbound_header", alias="a", label="其它出库单信息", columns={
		@Column(name="auto_id", attrName="autoId", label="主键", isPK=true),
		@Column(name="org_id", attrName="orgId", label="组织ID"),
		@Column(name="org_code", attrName="orgCode", label="组织编码"),
		@Column(name="org_name", attrName="orgName", label="组织名称", queryType=QueryType.LIKE),
		@Column(name="bill_no", attrName="billNo", label="出库单号"),
		@Column(name="bill_date", attrName="billDate", label="出库日期"),
		@Column(name="bill_status", attrName="billStatus", label="单据状态"),
		@Column(name="erp_bill_id", attrName="erpBillId", label="ERP单据ID"),
		@Column(name="erp_bill_no", attrName="erpBillNo", label="ERP单据号"),
		@Column(name="source_bill_type", attrName="sourceBillType", label="单据来源类型"),
		@Column(name="source_bill_id", attrName="sourceBillId", label="来源单据ID"),
		@Column(name="source_bill_no", attrName="sourceBillNo", label="来源单号"),
		@Column(name="business_type", attrName="businessType", label="业务类型"),
		@Column(name="warehouse_id", attrName="warehouseId", label="仓库ID", isUpdateForce=true),
		@Column(name="dept_id", attrName="deptId", label="部门ID", isUpdateForce=true),
		@Column(name="rd_code", attrName="rdCode", label="出库类别编码"),
		@Column(includeEntity=DataEntity.class),
		@Column(name="create_name", attrName="createName", label="创建人名称", queryType=QueryType.LIKE),
		@Column(name="update_name", attrName="updateName", label="更新人名称", queryType=QueryType.LIKE),
		@Column(name="audit_by", attrName="auditBy", label="审核人"),
		@Column(name="audit_name", attrName="auditName", label="审核人名称", queryType=QueryType.LIKE),
		@Column(name="audit_date", attrName="auditDate", label="审核时间", isUpdateForce=true),
	}, orderBy="a.update_date DESC"
)
public class OtherOutboundHeader extends DataEntity<OtherOutboundHeader> {
	
	private static final long serialVersionUID = 1L;
	private Long autoId;		// 主键
	private Long orgId;		// 组织ID
	private String orgCode;		// 组织编码
	private String orgName;		// 组织名称
	private String billNo;		// 出库单号
	private Date billDate;		// 出库日期
	private String billStatus;		// 单据状态
	private String erpBillId;		// ERP单据ID
	private String erpBillNo;		// ERP单据号
	private String sourceBillType;		// 单据来源类型
	private String sourceBillId;		// 来源单据ID
	private String sourceBillNo;		// 来源单号
	private String businessType;		// 业务类型
	private Long warehouseId;		// 仓库ID
	private Long deptId;		// 部门ID
	private String rdCode;		// 出库类别编码
	private String createName;		// 创建人名称
	private String updateName;		// 更新人名称
	private String auditBy;		// 审核人
	private String auditName;		// 审核人名称
	private Date auditDate;		// 审核时间
	private List<OtherOutboundLines> linesList = ListUtils.newArrayList();		// 子表列表

	public OtherOutboundHeader() {
		this(null);
	}
	
	public OtherOutboundHeader(String id){
		super(id);
	}
	
	@JsonSerialize(using = ToStringSerializer.class)
	public Long getAutoId() {
		return autoId;
	}

	public void setAutoId(Long autoId) {
		this.autoId = autoId;
	}
	
	@NotNull(message="组织ID不能为空")
	public Long getOrgId() {
		return orgId;
	}

	public void setOrgId(Long orgId) {
		this.orgId = orgId;
	}
	
	@NotBlank(message="组织编码不能为空")
	@Size(min=0, max=10, message="组织编码长度不能超过 10 个字符")
	public String getOrgCode() {
		return orgCode;
	}

	public void setOrgCode(String orgCode) {
		this.orgCode = orgCode;
	}
	
	@NotBlank(message="组织名称不能为空")
	@Size(min=0, max=30, message="组织名称长度不能超过 30 个字符")
	public String getOrgName() {
		return orgName;
	}

	public void setOrgName(String orgName) {
		this.orgName = orgName;
	}
	
	@NotBlank(message="出库单号不能为空")
	@Size(min=0, max=30, message="出库单号长度不能超过 30 个字符")
	public String getBillNo() {
		return billNo;
	}

	public void setBillNo(String billNo) {
		this.billNo = billNo;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
	@NotNull(message="出库日期不能为空")
	public Date getBillDate() {
		return billDate;
	}

	public void setBillDate(Date billDate) {
		this.billDate = billDate;
	}
	
	@Size(min=0, max=1, message="单据状态长度不能超过 1 个字符")
	public String getBillStatus() {
		return billStatus;
	}

	public void setBillStatus(String billStatus) {
		this.billStatus = billStatus;
	}
	
	@Size(min=0, max=30, message="ERP单据ID长度不能超过 30 个字符")
	public String getErpBillId() {
		return erpBillId;
	}

	public void setErpBillId(String erpBillId) {
		this.erpBillId = erpBillId;
	}
	
	@Size(min=0, max=30, message="ERP单据号长度不能超过 30 个字符")
	public String getErpBillNo() {
		return erpBillNo;
	}

	public void setErpBillNo(String erpBillNo) {
		this.erpBillNo = erpBillNo;
	}
	
	@Size(min=0, max=1, message="单据来源类型长度不能超过 1 个字符")
	public String getSourceBillType() {
		return sourceBillType;
	}

	public void setSourceBillType(String sourceBillType) {
		this.sourceBillType = sourceBillType;
	}
	
	@Size(min=0, max=64, message="来源单据ID长度不能超过 64 个字符")
	public String getSourceBillId() {
		return sourceBillId;
	}

	public void setSourceBillId(String sourceBillId) {
		this.sourceBillId = sourceBillId;
	}
	
	@Size(min=0, max=64, message="来源单号长度不能超过 64 个字符")
	public String getSourceBillNo() {
		return sourceBillNo;
	}

	public void setSourceBillNo(String sourceBillNo) {
		this.sourceBillNo = sourceBillNo;
	}
	
	@Size(min=0, max=30, message="业务类型长度不能超过 30 个字符")
	public String getBusinessType() {
		return businessType;
	}

	public void setBusinessType(String businessType) {
		this.businessType = businessType;
	}
	
	public Long getWarehouseId() {
		return warehouseId;
	}

	public void setWarehouseId(Long warehouseId) {
		this.warehouseId = warehouseId;
	}
	
	public Long getDeptId() {
		return deptId;
	}

	public void setDeptId(Long deptId) {
		this.deptId = deptId;
	}
	
	@NotBlank(message="出库类别编码不能为空")
	@Size(min=0, max=30, message="出库类别编码长度不能超过 30 个字符")
	public String getRdCode() {
		return rdCode;
	}

	public void setRdCode(String rdCode) {
		this.rdCode = rdCode;
	}
	
	@NotBlank(message="创建人名称不能为空")
	@Size(min=0, max=50, message="创建人名称长度不能超过 50 个字符")
	public String getCreateName() {
		return createName;
	}

	public void setCreateName(String createName) {
		this.createName = createName;
	}
	
	@NotBlank(message="更新人名称不能为空")
	@Size(min=0, max=50, message="更新人名称长度不能超过 50 个字符")
	public String getUpdateName() {
		return updateName;
	}

	public void setUpdateName(String updateName) {
		this.updateName = updateName;
	}
	
	@Size(min=0, max=30, message="审核人长度不能超过 30 个字符")
	public String getAuditBy() {
		return auditBy;
	}

	public void setAuditBy(String auditBy) {
		this.auditBy = auditBy;
	}
	
	@Size(min=0, max=50, message="审核人名称长度不能超过 50 个字符")
	public String getAuditName() {
		return auditName;
	}

	public void setAuditName(String auditName) {
		this.auditName = auditName;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
	public Date getAuditDate() {
		return auditDate;
	}

	public void setAuditDate(Date auditDate) {
		this.auditDate = auditDate;
	}
	
	@Valid
	public List<OtherOutboundLines> getLinesList() {
		return linesList;
	}

	public void setLinesList(List<OtherOutboundLines> linesList) {
		this.linesList = linesList;
	}
	
}